/*
 * @Author: sxb
 * @Email: sxb@mail.com
 * @Date: 2020-02-12 09:37:12
 * @Descripttion: 
 */
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';

import { Observable } from "rxjs"

@Injectable({
  providedIn: 'root'
})
export class AccountaliasManageService {

  private findAllUrl = '/api/accountalias/findAll';
  getFindAll(data): Observable<any> {
    return this.http.post(this.findAllUrl+"?alias="+ data.alias +"&page="+ data.page +"&size="+data.size, {}).pipe()
  }
  /**
   * @Author: sxb
   * @Email: sxb@mail.com
   * @Date: 2020-03-30 16:28:56
   * @UseComponent: 
   * @Descripttion: 根据别名查询信息
   * @Return: 
   */
  getFindByAlias(data): Observable<any> {
    return this.http.post("/api/accountalias/findByAlias?alias="+ data, {}).pipe()
  }

  /**
   * @Author: sxb
   * @Email: sxb@mail.com
   * @Date: 2020-03-06 14:56:59
   * @UseComponent: 多发多收使用
   * @Descripttion: 
   * @Return: 
   */
  getAccountalias(data): Observable<any> {
    return this.http.get("/api/accountalias", {params:data}).pipe()
  }

  private erpDataUrl="/api/accountalias/sync";
  erpData(): Observable<any> {
    let _dataJson = {
    }
    return this.http.get(this.erpDataUrl,_dataJson).pipe();
  }

  constructor(
    private http: HttpClient
  ) { }
}
